package com.siblings.loan.ui.permission.adapter

import android.view.View
import androidx.recyclerview.widget.RecyclerView
import com.siblings.lib_baseadapter.SIBRecyclerViewAdapter
import com.siblings.lib_baseadapter.SIBViewHolderHelper
import com.siblings.loan.R
import org.json.JSONObject

/**
 * Siblings
 * @Author wwdeng
 * @CreateTime: 2024/7/5 13:54
 * @Annotation：权限适配器
 */
class SibPermissionAdapter(recyclerView: RecyclerView?) : SIBRecyclerViewAdapter<JSONObject>(recyclerView, R.layout.item_permission) {

    override fun setItemChildListener(helper: SIBViewHolderHelper, viewType: Int) {
        helper.setItemChildClickListener(R.id.itemLayout) //点击Item
    }

    override fun fillData(helper: SIBViewHolderHelper, position: Int, model: JSONObject) {
        helper.setText(R.id.textTitle,model.optString("title"))
        helper.setVisibility(R.id.textTitle, View.GONE)
        helper.setText(R.id.textDes,model.optString("des"))
    }
}